#pragma once

#include <iostream>
#include <raylib.h>
#include "Color.hpp"

class Grid//整个方框
{
public:
    Grid();

    void Draw();

    void initialize();

    unsigned ClearAllRow();//清理所有的行，返回清理的行数

    bool PosIsEmpty(unsigned int row,unsigned int col);//判断某个左上角坐标的矩形是否被填充过

    bool IsOutRange(unsigned int row,unsigned int col);//判断是否超出范围

    unsigned int& grid(int row,int col);

private:
    bool RowIsFull(unsigned int row);

    void ClearRow(unsigned int row);

    void moveRowDown(unsigned int row,unsigned int RowNum);

private:
    int _cellSize = 30;
    int _numRow = 20;
    int _numCol = 10;

    unsigned int _grid[20][10];
};

